using ASP;
using HoWave.Data.Bll;
using HoWave.Data.Model;
using HoWave.Web.Shop.Member;
using System;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class Member_ClientRelation_ContacterDetailInfo : Member, IRequiresSessionState
{
	protected Label lblClient;
	protected Label Label1;
	protected Label lblTrueName;
	protected Label lblTitle;
	protected Label lblDepartment;
	protected Label lblPosition;
	protected Label lblOperation;
	protected Label lblCountry;
	protected Label lblProvinceCity;
	protected Label lblAddress;
	protected Label lblZipCode;
	protected Label lblOfficePhone;
	protected Label lblHomePhone;
	protected Label lblMobile;
	protected Label lblFax;
	protected Label lblHomepage;
	protected Label lblEmail;
	protected Label lblQQ;
	protected Label lblMSN;
	protected Label lblYahoo;
	protected Label lblUC;
	protected Label lblBirthday;
	protected Label lblIDCard;
	protected Label lblNativePlace;
	protected Label lblNation;
	protected Label lblSex;
	protected Label lblMarriage;
	protected Label lblEducation;
	protected Label lblGraduateFrom;
	protected Label lblInterestsOfLife;
	protected Label lblInterestsOfCulture;
	protected Label lblInterestsOfAmusement;
	protected Label lblInterestsOfSport;
	protected Label lblInterestsOfOther;
	protected Label lblIncome;
	protected Label lblFamily;
	protected PlaceHolder phContacterDetail;
	protected HtmlInputButton Button1;
	private int contacID = 0;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	public int ContacID
	{
		get
		{
			if (base.Request.QueryString["contacterID"] != null)
			{
				this.contacID = Convert.ToInt32(base.Request.QueryString["contacterID"].Trim());
			}
			return this.contacID;
		}
		set
		{
			this.contacID = value;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!base.IsPostBack)
		{
			if (!base.OwnerPowerClientRelation(base.user.UserID))
			{
				base.WriteRightErrMsg();
			}
			if (this.ContacID > 0)
			{
				this.InitPage();
			}
		}
	}
	protected void InitPage()
	{
		HoWave.Data.Model.ClientContacter model = HoWave.Data.Bll.ClientContacter.instance.GetModel(this.ContacID);
		if (model != null)
		{
			HoWave.Data.Model.Client model2 = HoWave.Data.Bll.Client.instance.GetModel((int)Convert.ToInt16(model.ClientID));
			if (model2 != null)
			{
				this.lblClient.Text = model2.ClientName;
			}
			this.lblTrueName.Text = model.TrueName;
			this.lblTitle.Text = model.Title;
			this.lblDepartment.Text = model.Department;
			this.lblPosition.Text = model.Position;
			this.lblOperation.Text = model.Operation;
			this.lblCountry.Text = model.Company;
			this.lblProvinceCity.Text = string.Concat(new string[]
			{
				model.Province,
				"&nbsp;",
				model.City,
				"&nbsp;",
				model.Districts
			});
			this.lblAddress.Text = model.Address;
			this.lblZipCode.Text = model.ZipCode;
			this.lblOfficePhone.Text = model.OfficePhone;
			this.lblHomePhone.Text = model.HomePhone;
			this.lblMobile.Text = model.Mobile;
			this.lblFax.Text = model.Fax;
			this.lblHomepage.Text = model.Homepage;
			this.lblEmail.Text = model.Email;
			this.lblQQ.Text = model.QQ;
			this.lblMSN.Text = model.MSN;
			this.lblYahoo.Text = model.Yahoo;
			this.lblUC.Text = model.UC;
			this.lblBirthday.Text = "";
			if (model.Birthday.HasValue)
			{
				this.lblBirthday.Text = model.Birthday.ToString();
			}
			this.lblBirthday.Text = model.Birthday.ToString();
			this.lblIDCard.Text = model.IDCard;
			this.lblNativePlace.Text = model.NativePlace;
			this.lblNation.Text = model.Nation;
			this.lblSex.Text = this.GetDictionaryTitle(model.Sex.ToString());
			this.lblMarriage.Text = this.GetDictionaryTitle(model.Marriage.ToString());
			this.lblEducation.Text = this.GetDictionaryTitle(model.Education);
			this.lblGraduateFrom.Text = model.GraduateFrom;
			this.lblInterestsOfLife.Text = model.InterestsOfLife;
			this.lblInterestsOfCulture.Text = model.InterestsOfCulture;
			this.lblInterestsOfAmusement.Text = model.InterestsOfAmusement;
			this.lblInterestsOfSport.Text = model.InterestsOfSport;
			this.lblInterestsOfOther.Text = model.InterestsOfOther;
			this.lblIncome.Text = this.GetDictionaryTitle(model.Income);
			this.lblFamily.Text = model.Family;
		}
	}
	protected string GetDictionaryTitle(string fieldValue)
	{
		string result = "";
		HoWave.Data.Model.Dictionary dictionary = HoWave.Data.Bll.Dictionary.instance.GetDictionary(fieldValue);
		if (dictionary != null)
		{
			result = dictionary.FieldText;
		}
		return result;
	}
}
